//
//  myLabel.m
//  myLabelAndmyImageView
//
//  Created by 苗钧豪 on 16/7/18.
//  Copyright © 2016年 苗钧豪. All rights reserved.
//

#import "myLabel.h"

@implementation myLabel
- (instancetype)initWithFrame:(CGRect)frame
{
    self = [super initWithFrame:frame];
    if (self) {
        UITapGestureRecognizer *tap = [[UITapGestureRecognizer alloc]initWithTarget:self action:@selector(tap:)];
        [self addGestureRecognizer:tap];
    }
    return self;
}
- (instancetype)initWithFrame:(CGRect)frame text:(NSString *)text
{
    self = [self initWithFrame:frame];
    if (self) {
        self.frame = frame;
        self.text = text;
    }
    return self;
}
- (void)tap:(UITapGestureRecognizer *)tap
{
    NSLog(@"哎呀！我被点击啦");
}
@end
